#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'

#define REP(i, x, y) for (auto i = (x), _##i = (y); i < _##i; ++i)
#define PER(i, x, y) for (auto i = (x), _##i = (y); i > _##i; --i)

template<class T=int>
inline void OO(const T &coll, const char *del = ",") {
    copy(coll.begin(), coll.end(), ostream_iterator<decltype(*coll.begin())>(cerr, del));
    cerr << endl;
}

vector<int> primes{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
int a[20];
int book[20];
int n;
bool flag = false;


void dfs(int k) {
    if (flag)return;
    if (k >= n) {
        if (binary_search(primes.begin(), primes.end(), a[k - 1] + a[0])) {
            copy(a, a + n, ostream_iterator<int>(cout, " "));
            cout << endl;
            flag = 1;
        }
        return;
    }
    for (int i = 0; i < n; i++) {
        if (book[i] == 1)continue;//查表
        //a[k]=i+1;  (i+1+a[k-1])
        if (!binary_search(primes.begin(), primes.end(), i + 1 + a[k - 1]))continue;
        a[k] = i + 1;
        book[i] = 1;//写入标记数组
        dfs(k + 1);
        book[i] = 0;//当我们访问完叶子结点后，必须要重置book[i]为未选择状态
    }


}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> n;
    if (n == 1) {
        cout << 1 << endl;
    } else if (n & 1) {
        cout << "no solution" << endl;
    } else {
        a[0] = 1;
        book[0] = true;
        dfs(1);
    }
    return 0;
}
